﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ServiceHost
{
    public class AlertHelper
    {
        public static void SendAlert()
        {
            //Get hotspots
            var hotspots = HotSpotHelper.GetAllHotSpots();

            //TODO: Find devices in the vicinity of the hotspots
            var allTokens = new List<string>();
            foreach (var hotSpot in hotspots)
            {
                var tokens = DeviceCoordinatesHelper.GetNearByDeviceTokens(hotSpot.Coordinate);
                allTokens.AddRange(tokens);
            }

            //TODO: Send push notification to the devices
            PushNotificationHelper.SendPushNotification(allTokens);
        }
    }
}